package edu.yctc.weblog.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import edu.yctc.weblog.entity.BlogDO;
import edu.yctc.weblog.utils.PageQueryUtil;

@Mapper
public interface BlogDAO {

    void insert(BlogDO blogDO);

    void deleteById(Long id);

    void update(BlogDO blogDO);

    BlogDO getBlogDOById(Long id);

    List<BlogDO> getBlogList(PageQueryUtil pageQueryUtil);

    List<BlogDO> getBlogListByType(@Param("type") int type, @Param("limit") int limit);

    int getTotalBlogDOs(PageQueryUtil pageUtil);

    void deleteBatch(Long[] ids);

    List<BlogDO> getBlogsPageByTagId(PageQueryUtil pageUtil);

    int getTotalBlogsByTagId(PageQueryUtil pageUtil);

    BlogDO getBlogDOBySubUrl(String subUrl);

    void updateBlogCategorys(@Param("categoryId") Long categoryId, @Param("ids") Long[] ids);
}